import request from '@/utils/request'

// 查询补料记录列表
export function listReplenish(query) {
  return request({
    url: '/pull/plug/list',
    method: 'get',
    params: query
  })
}

// 查询补料记录详细
export function getReplenish(plugId) {
  return request({
    url: '/pull/plug/' + plugId,
    method: 'get'
  })
}

// 查询工位树
export function getTree(shopType) {
  return request({
    url: '/base/shop/getTreeFindType/' + shopType,
    method: 'get'
  })
}

// 新增补料记录
export function addReplenish(data) {
  return request({
    url: '/pull/plug',
    method: 'post',
    data: data
  })
}

// 修改补料记录
export function updateReplenish(data) {
  return request({
    url: '/pull/plug',
    method: 'put',
    data: data
  })
}

// 删除补料记录
export function delReplenish(plugIds) {
  return request({
    url: '/pull/plug/' + plugIds,
    method: 'delete'
  })
}

// 下发仓库
export function transmitReplenish(plugIds) {
  return request({
    url: '/pull/plug/materialIssued',
    method: 'post',
    data: plugIds
  })
}

// 导出补料记录
export function exportReplenish(query) {
  return request({
    url: '/prod/plan/export',
    method: 'get',
    params: query
  })
}
